# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>

# this is needed only for gnome-flashback
pkgname=gnome-bluetooth-3
pkgver=3.34.5
pkgrel=0
pkgdesc="The GNOME Bluetooth Subsystem"
url="https://wiki.gnome.org/Projects/GnomeBluetooth"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
depends="hicolor-icon-theme bluez>=5 bluez-obexd"
makedepends="
	dconf-dev
	gobject-introspection-dev
	dbus-glib-dev
	eudev-dev
	libcanberra-dev
	libxi-dev
	gtk+3.0-dev
	libnotify-dev
	meson
	"
checkdepends="py3-dbus py3-gobject3 py3-dbusmock"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs"
source="https://download.gnome.org/sources/gnome-bluetooth/${pkgver%.*}/gnome-bluetooth-$pkgver.tar.xz
	61-gnome-bluetooth-rfkill.rules
	meson-0.60.patch
	"
builddir="$srcdir/gnome-bluetooth-$pkgver"

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -t 2 -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -m644 -D "$srcdir/61-gnome-bluetooth-rfkill.rules" \
		"$pkgdir/lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules"
}

sha512sums="
48431b3d19083705a6623442c5cd2d6c14962cdf30fc599ba47dceb6612b80142af77e1b6df142b530cb1015638081a06de38a3034177e0d05a354c40f19d9e5  gnome-bluetooth-3.34.5.tar.xz
68ea6502a469d800e92d8984984cfddfa66e7bf8a0252d52a2338843d183680c84aa7ec6c4c7d14a250515b34b71d89364480c809743ba9e7ef30473b8ebb5a8  61-gnome-bluetooth-rfkill.rules
ab33941ca5779e44b4ed2ca51fc1517fc5c3eb2936763bdaa763c2745ce9b705365b8c8cc2469ea97cfcc40d58fb6f1c56b218d0afc2e7a084b334a0972f4a00  meson-0.60.patch
"
